package com.swfee.qinben.httpactions;

import java.util.List;

import com.swfee.qinben.dto.req.BindEquipementReqDto;
import com.swfee.qinben.dto.req.EquipmentReqDto;
import com.swfee.qinben.dto.req.HealthMeasureReqDto;
import com.swfee.qinben.dto.req.ProcessTaskStatusReqDto;
import com.swfee.qinben.dto.req.ScheduleReqDto;
import com.swfee.qinben.dto.rsp.EquipmentRspDto;
import com.swfee.qinben.dto.rsp.HealthMeasureRspDto;
import com.swfee.qinben.dto.rsp.ResultRspDto;
import com.swfee.qinben.dto.rsp.ScheduleDayRspDto;
import com.swfee.qinben.dto.rsp.ScheduleDetailRspDto;
import com.swfee.qinben.dto.rsp.ScheduleRspDto;
import com.swfee.qinben.httpactions.base.ReqBaseAction;
import com.swfee.qinben.session.UserSession;

public class ScheduleAction extends ReqBaseAction<ScheduleReqDto,ScheduleRspDto> {

	
	public ScheduleAction() {
		super();
		setDefaultRspClass(ScheduleRspDto.class);
	}
	
	@Override
	public String getBaseActionUrl() {
		return "/webService/MedicalCare.NurseServices/Schedule.asmx";
	}
	

	
	//BindEquipementByScheduleId 
	public ResultRspDto bindEquipementByScheduleId (BindEquipementReqDto bindEquipementReqDto){
		
		String actionName = "/BindEquipementByScheduleId";
		return  (ResultRspDto) doHttpForObject(bindEquipementReqDto,actionName,ResultRspDto.class);
	}
	
	/**
	 * 
	 * @return
	 */
	public List<EquipmentRspDto> getAllEquipment() {
		
		String actionName = "/GetAllEquipments";
		return  (List<EquipmentRspDto>) doHttpForList(new EquipmentReqDto(),actionName,EquipmentRspDto.class);

	}
	
	
	//GetAllEquipments 
	public List<ScheduleDayRspDto> getAllScheduleDay(){
		String actionName = "/GetAllScheduleDay";
		return  (List<ScheduleDayRspDto>) doHttpForList(new ScheduleReqDto(),actionName,ScheduleDayRspDto.class);
	}
	
	//GetEquipmentsByScheduleId 
	public List<EquipmentRspDto> getEquipmentsByScheduleId(String scheduleId) {
		
		String actionName =  "/GetEquipmentsByScheduleId";
		EquipmentReqDto req = new EquipmentReqDto();
		req.setScheduleId(scheduleId);
		return  (List<EquipmentRspDto>) doHttpForList(req,actionName,EquipmentRspDto.class);

	}
	
	
	//GetHealthMeasureData
		public HealthMeasureRspDto getHealthMeasureData(HealthMeasureReqDto req){
			String actionName = "/GetHealthMeasureData";
			
			return  (HealthMeasureRspDto) doHttpForObject(req,actionName,HealthMeasureRspDto.class);
		}
	
	
	//GetScheduleById 
	public ScheduleDetailRspDto getScheduleById(String scheduleId) {
		String actionName = "/GetScheduleById";
		ScheduleReqDto req = new ScheduleReqDto();
		req.setScheduleId(scheduleId);
		return  (ScheduleDetailRspDto) doHttpForObject(req,actionName,ScheduleDetailRspDto.class);

	}
	
	/**
	 * 
	 * @return
	 */
	public List<ScheduleRspDto> getScheduleListByDay(String day) {
		String actionName = "/GetScheduleListByDay";
		ScheduleReqDto req = new ScheduleReqDto();
		req.setDay(day);
		return  doHttpForList(req,actionName);

	}

	//ProcessTaskStatus
	public ResultRspDto processTaskStatus(Integer scheduleId,Integer status){
		String actionName = "/ProcessTaskStatus";
		ProcessTaskStatusReqDto dto = new ProcessTaskStatusReqDto();
		dto.setScheduleId(scheduleId);
		dto.setStatus(status);
		dto.setNurseName(UserSession.getName());
		return  (ResultRspDto) doHttpForObject(dto,actionName,ResultRspDto.class);
	}


}
